﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace extags.handler
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class LayersTree : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string jsons = "[{\"id\": 1, \"text\": \"Census USA - States\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5\", \"serviceLayers\": \"\", \"serviceType\": 2, \"layerTp\": 9, \"checked\": false },";
            jsons = jsons + "{\"id\": 2, \"text\": \"Louisville - Fire Stations\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/1\", \"serviceLayers\": \"\", \"serviceType\": 2, \"layerTp\": 9, \"checked\": false },";
            jsons = jsons + "{\"id\": 3, \"text\": \"Louisville - Police Stations\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/3\", \"serviceLayers\": \"\", \"serviceType\": 2, \"layerTp\": 9, \"checked\": false },";
            jsons = jsons + "{\"id\": 4, \"text\": \"Kansas - Oil Gas Fields\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Petroleum/KGS_OilGasFields_Kansas/MapServer/0\", \"serviceLayers\": \"\", \"serviceType\": 2, \"layerTp\": 7, \"checked\": false},";
            jsons = jsons + "{\"id\": 5, \"text\": \"Bloomfield Hills Michigan\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/BloomfieldHillsMichigan/Parcels/MapServer/2\", \"serviceLayers\": \"\", \"serviceType\": 2, \"layerTp\": 7, \"checked\": false}]";
            //jsons = jsons + "{\"id\": 5, \"text\": \"Portland - Buildings\", \"leaf\": true, \"serviceUrl\": \"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer/3\", \"serviceLayers\": \"\", \"serviceType\": 3, \"layerTp\": 7, \"checked\": false}]";
            context.Response.Write(jsons);
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
